Desktop/Copy of GPS_TRACE/SRC/lcd.c File Reference

#include <inttypes.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#include "lcd.h"

Include dependency graph for lcd.c:

Go to the source code of this file.

Defines

#define DDR(x)   (*(&x - 1))
#define PIN(x)   (*(&x - 2))
#define lcd_e_delay()   __asm__ __volatile__( "rjmp 1f\n 1:" );
#define lcd_e_high()   LCD_E_PORT |= _BV(LCD_E_PIN);
#define lcd_e_low()   LCD_E_PORT &= ~_BV(LCD_E_PIN);
#define lcd_e_toggle()   toggle_e()
#define lcd_rw_high()   LCD_RW_PORT |= _BV(LCD_RW_PIN)
#define lcd_rw_low()   LCD_RW_PORT &= ~_BV(LCD_RW_PIN)
#define lcd_rs_high()   LCD_RS_PORT |= _BV(LCD_RS_PIN)
#define lcd_rs_low()   LCD_RS_PORT &= ~_BV(LCD_RS_PIN)
#define LCD_FUNCTION_DEFAULT   LCD_FUNCTION_4BIT_2LINES
#define delay(us)   _delayFourCycles( ( ( 1*(XTAL/4000) )*us)/1000 )

Functions

static void toggle_e (void)
static void _delayFourCycles (unsigned int __count)
static void lcd_write (uint8_t data, uint8_t rs)
static uint8_t lcd_read (uint8_t rs)
static uint8_t lcd_waitbusy (void)
static void lcd_newline (uint8_t pos)
void lcd_command (uint8_t cmd)
 Send LCD controller instruction command.
void lcd_data (uint8_t data)
 Send data byte to LCD controller.
void lcd_gotoxy (uint8_t x, uint8_t y)
 Set cursor to specified position.
int lcd_getxy (void)
void lcd_clrscr (void)
 Clear display and set cursor to home position.
void lcd_home (void)
 Set cursor to home position.
void lcd_putc (char c)
 Display character at current cursor position.
void lcd_puts (const char *s)
 Display string without auto linefeed.
void lcd_puts_p (const char *progmem_s)
 Display string from program memory without auto linefeed.
void lcd_init (uint8_t dispAttr)
 Initialize display and select type of cursor.


Define Documentation

#define DDR (  )     (*(&x - 1))

Definition at line 35 of file lcd.c.

Referenced by lcd_init(), lcd_read(), and lcd_write().

#define delay ( us   )     _delayFourCycles( ( ( 1*(XTAL/4000) )*us)/1000 )

Definition at line 113 of file lcd.c.

Referenced by lcd_init(), and lcd_waitbusy().

 
#define lcd_e_delay (  )     __asm__ __volatile__( "rjmp 1f\n 1:" );

Definition at line 45 of file lcd.c.

Referenced by lcd_read(), and toggle_e().

 
#define lcd_e_high (  )     LCD_E_PORT |= _BV(LCD_E_PIN);

Definition at line 46 of file lcd.c.

Referenced by lcd_read(), and toggle_e().

 
#define lcd_e_low (  )     LCD_E_PORT &= ~_BV(LCD_E_PIN);

Definition at line 47 of file lcd.c.

Referenced by lcd_read(), and toggle_e().

 
#define lcd_e_toggle (  )     toggle_e()

Definition at line 48 of file lcd.c.

Referenced by lcd_init(), and lcd_write().

#define LCD_FUNCTION_DEFAULT   LCD_FUNCTION_4BIT_2LINES

Definition at line 59 of file lcd.c.

Referenced by lcd_init().

 
#define lcd_rs_high (  )     LCD_RS_PORT |= _BV(LCD_RS_PIN)

Definition at line 51 of file lcd.c.

Referenced by lcd_read(), and lcd_write().

 
#define lcd_rs_low (  )     LCD_RS_PORT &= ~_BV(LCD_RS_PIN)

Definition at line 52 of file lcd.c.

Referenced by lcd_read(), and lcd_write().

 
#define lcd_rw_high (  )     LCD_RW_PORT |= _BV(LCD_RW_PIN)

Definition at line 49 of file lcd.c.

Referenced by lcd_read().

 
#define lcd_rw_low (  )     LCD_RW_PORT &= ~_BV(LCD_RW_PIN)

Definition at line 50 of file lcd.c.

Referenced by lcd_write().

#define PIN (  )     (*(&x - 2))

Definition at line 40 of file lcd.c.

Referenced by lcd_read().


Function Documentation

static void _delayFourCycles ( unsigned int  __count  )  [inline, static]

Definition at line 95 of file lcd.c.

int lcd_getxy ( void   ) 

Definition at line 408 of file lcd.c.

References lcd_waitbusy().

static void lcd_newline ( uint8_t  pos  )  [inline, static]

Definition at line 306 of file lcd.c.

References lcd_command(), LCD_DDRAM, LCD_START_LINE1, LCD_START_LINE2, LCD_START_LINE3, and LCD_START_LINE4.

Referenced by lcd_putc().

static uint8_t lcd_read ( uint8_t  rs  )  [static]

Definition at line 216 of file lcd.c.

References data, DDR, LCD_DATA0_PIN, LCD_DATA0_PORT, LCD_DATA1_PIN, LCD_DATA1_PORT, LCD_DATA2_PIN, LCD_DATA2_PORT, LCD_DATA3_PIN, LCD_DATA3_PORT, lcd_e_delay, lcd_e_high, lcd_e_low, lcd_rs_high, lcd_rs_low, lcd_rw_high, and PIN.

Referenced by lcd_waitbusy().

static uint8_t lcd_waitbusy ( void   )  [static]

Definition at line 285 of file lcd.c.

References delay, LCD_BUSY, and lcd_read().

Referenced by lcd_command(), lcd_data(), lcd_getxy(), and lcd_putc().

static void lcd_write ( uint8_t  data,
uint8_t  rs 
) [static]

Definition at line 135 of file lcd.c.

References DDR, LCD_DATA0_PIN, LCD_DATA0_PORT, LCD_DATA1_PIN, LCD_DATA1_PORT, LCD_DATA2_PIN, LCD_DATA2_PORT, LCD_DATA3_PIN, LCD_DATA3_PORT, lcd_e_toggle, lcd_rs_high, lcd_rs_low, and lcd_rw_low.

Referenced by lcd_command(), lcd_data(), lcd_init(), and lcd_putc().

static void toggle_e ( void   )  [static]

Definition at line 118 of file lcd.c.

References lcd_e_delay, lcd_e_high, and lcd_e_low.


Generated on Fri Aug 17 13:50:55 2007 for GPS TRACE by  doxygen 1.5.3